home *** CD-ROM | disk | FTP | other *** search
/ Cream of the Crop 22 / Cream of the Crop 22.iso / doom / quake3.zip / FLASHLT2.ZIP / FLASHLT.PAT < prev    next >
Text File  |  1996-08-22  |  5KB  |  202 lines

  1. diff -ur --new-file -x progs.dat -x progdefs.h -x *.bak -x *~ -x *.rej -x *.cfg -x *.sav v101qc/client.qc flashlt/client.qc
  2. --- v101qc/client.qc    Thu Jul 25 01:51:22 1996
  3. +++ flashlt/client.qc    Mon Aug  5 19:53:31 1996
  4. @@ -466,6 +466,7 @@
  5.      self.invincible_finished = 0;
  6.      self.effects = 0;
  7.      self.invincible_time = 0;
  8. +    self.impulsehandler=DefaultImpulseCommands;
  9.  
  10.      DecodeLevelParms ();
  11.      
  12. diff -ur --new-file -x progs.dat -x progdefs.h -x *.bak -x *~ -x *.rej -x *.cfg -x *.sav v101qc/defs.qc flashlt/defs.qc
  13. --- v101qc/defs.qc    Thu Jul 25 01:51:22 1996
  14. +++ flashlt/defs.qc    Mon Aug  5 19:53:32 1996
  15. @@ -690,4 +690,6 @@
  16.  
  17.  float(entity targ, entity inflictor) CanDamage;
  18.  
  19. -
  20. +.void() impulsehandler;
  21. +.float it_flashlight_on;
  22. +.entity it_flashlight_entity;
  23. diff -ur --new-file -x progs.dat -x progdefs.h -x *.bak -x *~ -x *.rej -x *.cfg -x *.sav v101qc/mktran.c flashlt/mktran.c
  24. --- v101qc/mktran.c    Wed Dec 31 18:00:00 1969
  25. +++ flashlt/mktran.c    Thu Aug 22 22:37:14 1996
  26. @@ -0,0 +1,32 @@
  27. +// A short program which outputs the transparent sprite I use
  28. +
  29. +void putl(long l) {
  30. +    putchar(l);
  31. +    putchar(l>>8);
  32. +    putchar(l>>16);
  33. +    putchar(l>>24);
  34. +}
  35. +
  36. +main() {
  37. +    putchar('I');
  38. +    putchar('D');
  39. +    putchar('S');
  40. +    putchar('P');
  41. +    putl(1); // version
  42. +    putl(2); // type
  43. +    putl(0); // bounding radius
  44. +    putl(1); // max width
  45. +    putl(1); // max height
  46. +    putl(1); // Number of frames
  47. +    putl(0); // "float beamlength"
  48. +    putl(0); // synchronousA
  49. +
  50. +    putl(0); // Single frame picture
  51. +    
  52. +    putl(0); // offsx
  53. +    putl(0); // offsy
  54. +    putl(1); // width
  55. +    putl(1); // height
  56. +    putchar(0xff); //transparent pixel
  57. +};
  58. +
  59. Binary files v101qc/progs/null.spr and flashlt/progs/null.spr differ
  60. diff -ur --new-file -x progs.dat -x progdefs.h -x *.bak -x *~ -x *.rej -x *.cfg -x *.sav v101qc/weapons.qc flashlt/weapons.qc
  61. --- v101qc/weapons.qc    Thu Jul 25 01:51:24 1996
  62. +++ flashlt/weapons.qc    Thu Aug 15 18:30:30 1996
  63. @@ -22,6 +22,8 @@
  64.      precache_sound ("weapons/grenade.wav");    // grenade launcher
  65.      precache_sound ("weapons/bounce.wav");        // grenade bounce
  66.      precache_sound ("weapons/shotgn2.wav");    // super shotgun
  67. +
  68. +    precache_model ("progs/null.spr");    // flashlight
  69.  };
  70.  
  71.  float() crandom =
  72. @@ -1130,6 +1132,69 @@
  73.  
  74.  };
  75.  
  76. +void() it_flashlight_aim = {
  77. +    local vector direction, src;
  78. +    local entity pl; // Player
  79. +    local float temp;
  80. +
  81. +    pl=self.owner;
  82. +//    if(pl.ammo_cells < 0 || ! pl.flags & FL_GODMODE) {
  83. +//        pl.it_flashlight_on=0;
  84. +//        pl.it_flashlight_entity=world;
  85. +//        remove(self);
  86. +//        return;
  87. +//    }
  88. +    makevectors(pl.v_angle);
  89. +    
  90. +    src = pl.origin + v_forward*10;
  91. +    src_z = pl.absmin_z + pl.size_z * 0.7;
  92. +
  93. +    direction=aim(pl, 100000);
  94. +    traceline(src, src + direction * 2048, FALSE, pl);
  95. +    src=0.1*src+0.9*trace_endpos;
  96. +    setorigin(self, src);
  97. +
  98. +//    dprint(vtos(trace_endpos));
  99. +//    dprint("\n");
  100. +
  101. +    self.nextthink=time+0.05;
  102. +//    if(pl.ammo_cells==0) return; /* God mode */
  103. +//    temp=pl.ammo_cells;
  104. +//    if(pl.currentammo==temp) /* FIXME */
  105. +//        pl.currentammo=temp - 1;
  106. +//    pl.ammo_cells=temp - 1;
  107. +};
  108. +
  109. +void() I_FlashlightToggle =
  110. +{
  111. +    local entity oldself;
  112. +    if(self.it_flashlight_on) {
  113. +        if(self.it_flashlight_entity) remove(self.it_flashlight_entity);
  114. +        self.it_flashlight_entity=world;
  115. +        self.it_flashlight_on=0;
  116. +        self.effects=self.effects &! EF_DIMLIGHT;
  117. +    } else {
  118. +        self.it_flashlight_on=1;
  119. +        oldself=self;
  120. +        self.it_flashlight_entity=spawn();
  121. +        self=self.it_flashlight_entity;
  122. +
  123. +        self.movetype= MOVETYPE_NONE;
  124. +        self.solid = SOLID_NOT;
  125. +        setmodel(self, "progs/null.spr");
  126. +        setsize (self, '0 0 0', '0 0 0');        
  127. +        
  128. +        self.effects=EF_DIMLIGHT;
  129. +        self.owner=oldself;
  130. +        self.owner.effects=EF_DIMLIGHT;
  131. +        self.nextthink=time+1;
  132. +        self.think=it_flashlight_aim;
  133. +        it_flashlight_aim();
  134. +        self=oldself;
  135. +    }
  136. +        
  137. +};
  138. +
  139.  /*
  140.  ============
  141.  ServerflagsCommand
  142. @@ -1158,7 +1223,8 @@
  143.  
  144.  ============
  145.  */
  146. -void() ImpulseCommands =
  147. +void() ExtendedImpulseCommands;
  148. +void() DefaultImpulseCommands =
  149.  {
  150.      if (self.impulse >= 1 && self.impulse <= 8)
  151.          W_ChangeWeapon ();
  152. @@ -1169,11 +1235,49 @@
  153.          CycleWeaponCommand ();
  154.      if (self.impulse == 11)
  155.          ServerflagsCommand ();
  156. +    if(self.impulse==12)
  157. +        I_FlashlightToggle ();
  158.  
  159. +    if (self.impulse == 254)
  160. +        self.impulsehandler=ExtendedImpulseCommands;
  161.      if (self.impulse == 255)
  162.          QuadCheat ();
  163.          
  164.      self.impulse = 0;
  165. +};
  166. +
  167. +void() WeaponImpulseCommands =
  168. +{
  169. +    self.impulsehandler=DefaultImpulseCommands;
  170. +    if (self.impulse >= 1 && self.impulse <= 8)
  171. +        W_ChangeWeapon ();
  172. +
  173. +    if (self.impulse == 9)
  174. +        CheatCommand ();
  175. +    if (self.impulse == 10)
  176. +        CycleWeaponCommand ();
  177. +};
  178. +
  179. +void() ItemImpulseCommands =
  180. +{
  181. +    self.impulsehandler=DefaultImpulseCommands;
  182. +    if(self.impulse==1)
  183. +        I_FlashlightToggle();
  184. +};
  185. +
  186. +void() ExtendedImpulseCommands =
  187. +{
  188. +    if(self.impulse==254)
  189. +        self.impulsehandler=DefaultImpulseCommands;
  190. +    else if(self.impulse==1)
  191. +        self.impulsehandler=WeaponImpulseCommands;
  192. +    else if(self.impulse==2)
  193. +        self.impulsehandler=ItemImpulseCommands;
  194. +};
  195. +
  196. +void() ImpulseCommands =
  197. +{
  198. +    self.impulsehandler();
  199.  };
  200.  
  201.  /*
  202.